using UnityEngine;
using System.Collections;

public class DeathCheck : MonoBehaviour 
{

	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(!GameObject.FindGameObjectWithTag("Player1").GetComponent<Movement>().isAlive && !GameObject.FindGameObjectWithTag("Player2").GetComponent<Movement>().isAlive)
		{
			foreach(CharacterDescriptions go in gameObject.GetComponentsInChildren<CharacterDescriptions>())
			{
				go.shouldDisplay = true;
			}
		}
		else
		{
			foreach(CharacterDescriptions go in gameObject.GetComponentsInChildren<CharacterDescriptions>())
			{
				go.shouldDisplay = false;
			}
		}
	}
}
